;
var HYIP = {};
HYIP = {};
//ajax请求
//timeout：用户未登陆的跳转回调
//error：服务器错误的回调
HYIP.ajaxTryTimes = 0;
HYIP.ajax = function(url, param, success, failed, error) {
	param.r = Math.random() * 10;
	$.ajax({
		url: http + url, //请求访问地址
		dataType: 'json', //访问格式，如：json、html等
		timeout: 10000, //请求访问时间
		data: param,
		//async: false,
		type: 'post', //请求访问方式，如post、get
		cache: false, //ajax不缓存，true缓存，false不缓存
		success: function(data) {
			if(data.success) {
				(success || function() {})(data);
			} else {
				if(failed) {
					failed(data);
					return;
				} else {
					layer.open({
					  title: '提示',
					  content: "<span class='red'>" + data.msg + "</span>"
					});
					return;
				}
				if(data.code == 200){
					layer.open({
					  	title: '提示',
					  	content: "<span class='red'>" + data.msg + "</span>"
					});
				}else if(data.code != 200){
					layer.open({
					  	title: '提示',
					  	content: "<span class='red'>" + data.msg + "</span>"
					});
				}
				
			}
		},
		error: function(jqXHR, textStatus, errorThrown) {
			if(error) {
				error();
			} else {
				layer.open({
				  title: '提示',
				  content: "<span class='red'>服务器繁忙，请稍候重试！</span>"
				});
				return;
			}
		}
	});
};

var request =
{
	QueryString : function(val)
	{
		var reg = new RegExp("(^|&)" + val + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
		var r = window.location.search.substr(1).match(reg);  //匹配目标参数
		if (r != null) return decodeURI(r[2]); return null; //返回参数值
	}
}
var userId = request.QueryString("id");

var xX = ["A", "B", "C", "D", "E", "F", "G", "H"];
var  menuAttr = ["一", "二", "三", "四", "五", "六", "七", "八"];

